﻿<UserControl x:Class="PairingMatrix.View.TimerControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Behaviors="clr-namespace:PairingMatrix.View.Behavior" xmlns:Converter="clr-namespace:PairingMatrix.View.Converter" mc:Ignorable="d" 
             Height="40" Width="60">
	<UserControl.Resources>
		<Converter:BoolToVisibilityConverter x:Key="boolToVisibilityConverter" />
	</UserControl.Resources>
	<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
		<Rectangle RadiusX="10" RadiusY="10" Stroke="#FFE58484">
			<Rectangle.Fill>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FFFCB5B5" Offset="0" />
					<GradientStop Color="#FFFFBEBE" Offset="1" />
					<GradientStop Color="#FFEB9191" Offset="0.5" />
				</LinearGradientBrush>
			</Rectangle.Fill>
		</Rectangle>
		<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Width="30">
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition Width="10" />
			</Grid.ColumnDefinitions>
			<TextBlock Grid.Column="0" HorizontalAlignment="Right" Name="timer" Text="{Binding Path=Minutes}" FontFamily="Fonts/Fonts.zip#Consolas" FontSize="20" Foreground="#FF834A4A" />
			<TextBlock Grid.Column="1" Text=":" FontFamily="Fonts/Fonts.zip#Consolas" FontSize="20" Foreground="#FF834A4A" Visibility="{Binding Path=ShowSecond, Converter={StaticResource boolToVisibilityConverter}}" />
		</Grid>        
	</Grid>
    <UserControl.RenderTransform>
        <ScaleTransform CenterX="20" CenterY="30" x:Name="scale"/>
    </UserControl.RenderTransform>
	<i:Interaction.Behaviors>
		<Behaviors:TimerMouseClickBehavior />
	</i:Interaction.Behaviors>
</UserControl>
